<?php

namespace MyApp\Hook;

use RedBean_Facade as R;

class Friendship
{
    public static function afterCreate($friendship)
    {
        $app = \Slim\Slim::getInstance();
        if ($app->friend) {
            $app->friend->points = mt_rand(1, 99);
            R::store($app->friend);
        }
    }
}